var url_TeacherData = basePath + "teacher/getTeacherData";
var tblStudent;
$(function () {
    tblStudent = $('#tbl-student').DataTable(buildStudentsOptions());
    trCssEvent(tblStudent);
    $("#btn-search-student").click(studentSearch);
});


function buildStudentsOptions() {
    var options = {
        "searching": false,
        "ordering": true,
        "processing": true,
        "language": {
            "url": plugPath + 'DataTables/chinese.json'
        },
        "serverSide": true,
        "ajax": {
            "url": basePath + "teacher/getCenterData",
            "type": 'POST',
            data: function (params) {
                params['centerName'] = $("#centerNames").val();
            }
        },

        "columns": [{
            "data": "centerName"
        },  {}],
        columnDefs: [{
            "targets": [1],
            "data": "centerId",
            "render": function (data, type, row, meta, full) {
                return "<a href='goStudentPage?centerId="+data+"' target='_blank'>【查看该中心的学生信息】</a>";
            }
        }],

        "dom" : "<'row'<'col-xs-12't>><'row'<'col-xs-2 lstyle'l><'col-xs-3'i><'col-xs-6  fright'p>>"
        
    };
    return options;
}


//查询搜索中心
function studentSearch() {
    $("#btn-search-student").attr("disabled", "disabled");
    tblStudent.ajax.reload(function () {
        $("#btn-search-student").removeAttr("disabled");
    });
}




